<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
	<meta name="format-detection" content="telephone=no" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="apple-touch-fullscreen" content="yes">
	<meta content="telephone=no,email=no" name="format-detection" />
	<meta name="flexible" content="initial-dpr=2,maximum-dpr=3" />
	<title>羊仓健康生活家</title>
</head>
<script type="text/javascript">
    var basePath="http://${header['host']}${pageContext.request.contextPath}";
    var resultData = '${resultData}';
    var code = '${resultData.code}';
    var access_token = '${resultData.data.accessToken}';
    var openId = '${resultData.data.openId}';
    var errorMsg = '${resultData.msg}';
	if(openId==''
			||typeof openId == "undefined"
			||typeof access_token == "undefined"
			||access_token==''
	){
		window.location.href= basePath+"/yangcangclub/v1/user/wx/login";
	}
</script>

	<link rel="stylesheet" href="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/css/index.css" />
	<link rel="stylesheet" href="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/css/style.css" />
	<link rel="stylesheet" href="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/css/swiper.min.css" />
	<script type="text/javascript" src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/js/jquery.min.js" ></script>
	<script type="text/javascript" src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/js/flexible.js" ></script>
	<script type="text/javascript" src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/js/swiper.min.js" ></script>
	<script type="text/javascript" src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/js/index.js" ></script>
	<script type="text/javascript" src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/js/basePathUtil.js" ></script>
	<script type="text/javascript" src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/js/layer-mobile/layer.js" ></script>
	<script type="text/javascript" src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/js/init.js" ></script>
	<!--<script type="text/javascript" src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/js/zepto.min.js" ></script>
	<script type="text/javascript" src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/js/touch.js" ></script>-->

	
</head>
<body style="background: #F2F2F2;">
<div id='wx_logo' style='margin:0 auto;display:none;'>
	<img src='http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/ico.png' />
</div>
<div class="warp">
    <!-- 轮播开始  -->
	<div class="banner-swiper swiper">
		<div id="banner-cont" class="swiper-container">
			<div class="banner-wrapper swiper-wrapper" id="swiperlist">
			</div>
			<div class="swiper-pagination"></div>	
		</div>
	</div>
	<!-- 轮播结束 -->
    
	<!--无缝滚动开始-->
	<!--<div id="demo" class="qimo8">
		<div class="qimo">
			<div id="demo1">
				<ul><li><a href='' >羊仓公告：所有商品一律65折！</a></li>
					<li><a href='' >羊仓公告：所有商品一律65折！</a></li>
				</ul>
			</div>
			<div id="demo2"></div>
		</div>
	</div>-->
	<!--无缝滚动结束-->
	
	<!--富硒优礼开始-->
	<div class="activ">
		<div class="aleft">
			<div class="activ-left">
				<div class="left-txt"><p>富硒产品</p></div>
				<a href="javascript: window.location.href='/yangcangclub/res/mryx.html?access_token=${resultData.data.accessToken}&type=1'">
					<img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/02.png">
				</a>
			</div>
		</div>
		<div class="aright">
			<div class="activ-right">
				<div class="right-txt"><p>每日优选</p></div>
				<a href="javascript: window.location.href='/yangcangclub/res/mryx.html?access_token=${resultData.data.accessToken}&type=2'">
					<img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/03.png">
				</a>
			</div>
		</div>

	</div>
	<!--富硒优礼结束-->
	
	<!--限时购开始-->
	<div id="content">
		<div class="timeshop">
			<p>限时购</p>
		</div>
		<div class="contimer">
		<div class="timer">
			<div class="left-boder"></div>
			<div class="time-item">
				<!--<span id="day_show">0天</span>-->
				<strong id="hour_show"></strong>
				<span>:</span>
				<strong id="minute_show"></strong>
				<span>:</span>
				<strong id="second_show"></strong>
			</div>
			<div class="right-boder"></div>
		</div>
		<div class="txt">
			<div class="t-left">
				<div class="cont-img" id="limitPBanner">
					<%--<a href="javascript: layer.open({content: '待开发', skin: 'msg', time: 2});">--%>
						<%--<img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/04.png" >--%>
					<%--</a>--%>
				</div>
			</div>
			<div class="t-right">
				<div class="cont-tit ">
					<div class="h3" id="limitPName">
						<%--<p>午茶夫人养甘菊香柚绿菜</p>--%>
					</div>
					<div class="h4">
						<%--<p>源自台湾纯天然原装进口</p>--%>
					</div>
					<p id="limitPPrice">
                        <%--<span class="hour">限时价</span><span class="Price">￥19:00</span><span class="yprice">原价<s>￥59:00</s></span>--%>
                    </p>
					<button class="btn" id="limitBuyBtn">
						<p>马上抢</p>
					</button>
				</div>
			</div>
		</div>
		</div>
	</div>
	<!--限时购结束-->
	
	<!--精选商品开始-->
	<div class="Select swiper-container" id="concentrateList">
		<div class="s-tit">
			<p>精选商品</p>
		</div>
		<div id="s-img" class="s-img swiper-wrapper">

			<%--<div class="s-left swiper-slide">--%>
				<%--<div class="img-left">1</div>--%>
			<%--</div>--%>
			<%--<div class="s-left swiper-slide">--%>
				<%--<div class="img-left">2</div>--%>
			<%--</div>--%>
			<%--<div class="s-left swiper-slide">--%>
				<%--<div class="img-left">3</div>--%>
			<%--</div>--%>
			<%--<div class="s-left swiper-slide">--%>
				<%--<div class="img-left">4</div>--%>
			<%--</div>--%>
			<%--<div class="s-left swiper-slide">--%>
				<%--<div class="img-left">5</div>--%>
			<%--</div>--%>
			<!--<div class="s-left swiper-slide">
				<div class="img-left"></div>
			</div>-->

			<!--<div class="s-right swiper-slide">
				<div class="img-right"></div>
			</div>-->
		</div>
	</div>
	
	<!--精选商品结束-->
	<!--羊仓市集开始-->
		<div class="ycity" style="margin-top: 0.3125rem;">
			<div class="yctit">
				<p>羊仓市集</p>
				<!--<span><img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/zs.png"></span>-->
			</div>
			<div class="ycont">
				<a class="ycont-left" href="javascript: window.location.href='/yangcangclub/res/ynan.html?access_token=${resultData.data.accessToken}&type=5'">
				<!--<a href="#" class="ycont-left">-->
					<div class="z-banck">
						<p style="color: #333;font-size:0.40625rem;line-height: 1.5em; width:0.5rem;margin:0.2rem 0.24rem;">云南仓</p>
					</div>
					<img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/ync.png">
				</a>
				<!--<div href="#" class="ycont-right">
					<a href="#" class="ycont-rightjpg" style="margin-bottom: 0.0625rem">
						<div class="zbanck">
							<p style="color: #333;font-size:0.40625rem;text-align:center; margin:0.2rem 0;">中设仓</p>
						</div>
						<img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/yci2.png">
					</a>
					<a href="#" class="ycont-rightpng">
						<div class="zback">
							<p style="color: #333;font-size:0.40625rem;text-align:center; margin:0.2rem 0;">贵州仓</p>
						</div>
						<img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/yci3.png">
					</a>
				</div>-->
			</div>
		</div>
	<!--羊仓市集结束-->
	<!--推荐商品开始-->
	<div class="container" style="background: #fff;">
		<div class="r-tit">
			<p>推荐商品</p>
		</div>
		<div id="container" style="background: #fff;">
			<!--<div class="box">
				<div class="box_img">
					<img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/10.png" alt="">
				</div>
				<div class="img-text imgtext">
					<p>植者丹麦进口薄荷绿茶包便携带滤袋</p>
				</div>
				<div class="img-text1 imgtext1">
					<p>￥29.00</p>
				</div>
			</div>
			
			
			<div class="box">
				<div class="box_img">
					<img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/10.png" alt="">
				</div>
				<div class="img-text imgtext">
					<p>植者丹麦进口薄荷绿茶包便携带滤袋</p>
				</div>
				<div class="img-text1 imgtext1">
					<p>￥29.00</p>
				</div>
			</div>-->
			
			
			<%--<div class="box">--%>
				<%--<div class="box_img">--%>
					<%--<img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/10.png" alt="">--%>
				<%--</div>--%>
				<%--<div class="img-text imgtext">--%>
					<%--<p>植者丹麦进口薄荷绿茶包便携带滤袋</p>--%>
				<%--</div>--%>
				<%--<div class="img-text1 imgtext1">--%>
					<%--<p>￥29.00</p>--%>
				<%--</div>--%>
			<%--</div>--%>
			
			
			<%--<div class="box box_2">--%>
				<%--<div class="box_img">--%>
					<%--<img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/10.png" alt="">--%>
				<%--</div>--%>
				<%--<div class="img-text imgtext">--%>
					<%--<p>植者丹麦进口薄荷绿茶包便携带滤袋</p>--%>
				<%--</div>--%>
				<%--<div class="img-text1 imgtext1">--%>
					<%--<p>￥29.00</p>--%>
				<%--</div>--%>
			<%--</div>--%>

		</div>
	</div>	
	<!--推荐商品结束-->
	<!--底导航开始-->
	<div id="nav">
		<ul class="nav-ul">
			<li><a href="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/v1/user/wx/login"><img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/01—.png"><p style="color:#007234">首页</p></a></li>
			<!--<li><a href="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/xsg.html?access_token=${resultData.data.accessToken}&type=3"><img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/2.png"><p>限时购</p></a></li>-->
			<li><a href="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/mryx.html?access_token=${resultData.data.accessToken}&type=2"><img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/3.png"><p>每日优选</p></a></li>
			<li><a href="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/gwc.html?access_token=${resultData.data.accessToken}"><img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/4.png"><p>购物车</p></a></li>
			<li><a href="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/usercenter.html?access_token=${resultData.data.accessToken}"><img src="http://${header['host']}${pageContext.request.contextPath}/yangcangclub/res/img/5.png"><p>我的</p></a></li>
		</ul>
	</div>
	<!--底导航开始-->
</div>
</body>

<!--无缝滚动结束--
<script type="text/javascript">
	var demo = document.getElementById("demo");
	var demo1 = document.getElementById("demo1");
	var demo2 = document.getElementById("demo2");
	demo2.innerHTML=document.getElementById("demo1").innerHTML;
	function Marquee(){
		if(demo.scrollLeft-demo2.offsetWidth>=0){
			demo.scrollLeft-=demo1.offsetWidth;
		}
		else{
			demo.scrollLeft++;
		}
	}
	var myvar=setInterval(Marquee,30);
//	demo.onmouseout=function (){myvar=setInterval(Marquee,30);}
//	demo.onmouseover=function(){clearInterval(myvar);}
</script>
<!--倒计时-->
<script type="text/javascript">
 var t =0;
 function GetRTime(){
     t=t-1000;
    var h=0;
     var m=0;
     var s=0;
     if(t>0){
         h=Math.floor(t/1000/3600);
         m=Math.floor(t/1000/60-h*60);
         s=Math.floor(t/1000-h*3600-m*60);
     }else{
         $("#limitBuyBtn").html("<p>马上抢</p>");

           window.location.href=window.location;
     }
     if (m <= 9) m = '0' + m;
	if (s <= 9) s = '0' + s;
    document.getElementById("hour_show").innerHTML = h + "";
    document.getElementById("minute_show").innerHTML = m + "";
    document.getElementById("second_show").innerHTML = s + "";
  }
    setInterval(GetRTime,1000);
</script>

<script>
//var swiper = new Swiper('.swiper-container', {
//  pagination: '.swiper-pagination',
//  slidesPerView:auto,
//  paginationClickable: true,
//  spaceBetween: 30
//});

var mySwiper = new Swiper('.swiper-container',{
onSetWrapperTransform: function(swiper){
       //自定义事件
    }
})
</script>

<!--瀑布流-->
<script>
	function load(){
		var backParent=document.getElementsByClassName('container');
		var cParent=document.getElementById('container');
		var ccContent=getChildElement(cParent,'box');
		var lastTop=ccContent[ccContent.length-1].offsetTop;
		var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;
		var pageHeight=document.documentElement.clientHeight||document.body.clientHeight;
		
		if(lastTop<scrollTop+pageHeight){
			return true;
		}else{
			return false;
		}
	}

	function imglocation(parent,content){
		var cParent=document.getElementById(parent);
		var ccContent=getChildElement(cParent,content);
		var imgWidth=ccContent[0].offsetWidth;
		var num=Math.floor(document.documentElement.clientWidth/imgWidth);
		//alert(imgWidth*cols)
		cParent.style.cssText='width:'+imgWidth*num+'px;margin:0 auto';


		//高度数组;
		var boxHeightArr=[];
		for(var i = 0 ; i < ccContent.length; i ++){
			if(i<num){
				boxHeightArr[i]=ccContent[i].offsetHeight;
			}else{
				var minHeight=Math.min.apply(null,boxHeightArr);
				ccContent[i].style.position='absolute';
				//console.log(minHeight)
				ccContent[i].style.top=minHeight+'px';
				var minIndex=getMinPostioin(boxHeightArr,minHeight);
				ccContent[i].style.left=ccContent[minIndex].offsetLeft+'px';
				//关键点,改变数组；
				boxHeightArr[minIndex]=boxHeightArr[minIndex]+ccContent[i].offsetHeight;
			}
		}
		//console.log(boxHeightArr)


	}

	function getMinPostioin(boxHeightArr,minHeight){
		for(var i = 0 ; i < boxHeightArr.length; i ++){
			if(boxHeightArr[i]==minHeight){
				return i;
			}
		}
	}

	function getChildElement(parent,content){

		var contentArr=[];
		var allcontent=parent.getElementsByTagName("*");
		for(var i = 0 ; i < allcontent.length ; i++){
			if(allcontent[i].className==content){
				contentArr.push(allcontent[i])
			}
		}
		return contentArr;

	}
</script>

</html>


